const mysql = require('mysql2/promise');

async function query() {
  try {
    const connection = await mysql.createConnection({
      host: 'localhost',
      user: 'root',
      password: 'password',
      database: 'community_service_platform'
    });
    
    // 查询shared_skills表中的service_method字段值
    const [rows] = await connection.execute('SELECT service_method FROM shared_skills LIMIT 10');
    console.log('service_method值:', rows);
    
    // 同时查询表结构，确认字段类型
    const [columns] = await connection.execute('DESCRIBE shared_skills');
    console.log('表结构:', columns.filter(col => col.Field === 'service_method'));
    
    await connection.end();
  } catch (err) {
    console.error('查询失败:', err);
  }
}

query();